from django.db import models

# 供应商
class Company(models.Model):
    name = models.CharField(max_length=32,verbose_name='企业简称')
    mobile = models.CharField(max_length=11,verbose_name='手机号码')
    password = models.CharField(max_length=32,verbose_name='密码')

    auth_type = models.SmallIntegerField(verbose_name="认证类型",choices=((1,"未认证"),(2,"认证中"),(3,'已认证')),default=1)
    ctime = models.DateTimeField(auto_now_add=True,verbose_name='注册时间')
    # 可用余额
    balance = models.DecimalField(verbose_name="账户余额",default=0,max_digits=10,decimal_places=2)
    # 不可用余额
    freeze_balance = models.DecimalField(verbose_name="不可用余额",default=0,max_digits=10,decimal_places=2)


#供应商认证
class CompanyAuth(models.Model):
    # company = models.ForeignKey(verbose_name="公司",to="Company",on_delete=models.CASCADE)
    company = models.OneToOneField(verbose_name="公司",to="Company",on_delete=models.CASCADE)
    title = models.CharField(max_length=64,verbose_name="公司全程")
    unique_id=models.CharField(max_length=64,verbose_name="信用代码")
    licence_path = models.CharField(max_length=64,verbose_name="营业执照")
    leader = models.CharField(max_length=64,verbose_name="法人")
    leader_identity = models.CharField(max_length=64,verbose_name="法人身份证")



